<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        云客客户关系管理系统
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/static/css/x-admin.css" media="all">
</head>

<div class="x-body">
    
    <h3 style="color:orange" >添加资料基本信息</h3>
    <form class="form-horizontal" action="/file/saveFile" method="post" >
         <div class="layui-form-item" >
            <label for="id" class="layui-form-label" > <span
                    class="x-red">*</span>资料编号：
            </label>
            <div class="layui-input-inline">
                <input type="text" id="id" name="id" required=""
                       lay-verify="name" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>将会成为唯一的合同编号
            </div>
        </div> 
        <div class="layui-form-item" >
            <label for="name" class="layui-form-label" > <span
                    class="x-red">*</span>资料名称：
            </label>
            <div class="layui-input-inline">
                <input type="text" id="name" name="name" required=""
                       lay-verify="name" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>将会成为唯一的合同名称
            </div>
        </div>
        <div class="layui-form-item" >
            <label for="orgId" class="layui-form-label"  > <span
                    class="x-red">*</span>机构名称：
            </label>
            <div class="layui-input-inline">
                 <select name="orgId" id="orgId" style="width:185px">
                  <option value="">请选择机构名称</option>               
                  <#list orgList as ols>                
                  <option value="${ols.id }">${ols.name}</option>
                 </#list>            
            </select>
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>将会成为唯一的合同名称
            </div>
        </div>
        <div class="layui-form-item">
            <label for="kind" class="layui-form-label" >
                <span class="x-red">*</span>资料分类：
            </label>
            <div class="layui-input-inline" >                          
                <select name="kind" lay-verify="required" lay-search id="kind" style="width:185px">
                    <option value="" >请选择资料分类</option>
                    <option value="培训">培训</option>
                    <option value="教材">教材</option>
                    <option value="外文">外文</option>
                    <option value="专业前沿">专业前沿</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="operatorId" class="layui-form-label" >
                <span class="x-red">*</span>发布者：
            </label>
            <div class="layui-input-inline">
            <input type="text" id="operatorId" name="operatorId" required=""
                       lay-verify="date" autocomplete="off" class="layui-input">
                <!--  <select name="operatorId" id="operatorId" style="width:185px">
                <option value="">请选择发布者</option>               
                 <#list proKinds as ols>                
                  <option value="${ols.id }">${ols.name}</option>
                 </#list>             
                </select>-->  
            </div>
            		            
        <div class="layui-form-item">
            <label for="createDate" class="layui-form-label" > <span
                    class="x-red">*</span>发布日期：
            </label>
            <div class="layui-input-inline">
                <input type="text" id="createDate" name="createDate" required=""
                       lay-verify="date" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
            </div>
        </div>      
        <div class="layui-form-item">
            <label for="type" class="layui-form-label" > <span
                    class="x-red">*</span>文件类型：
            </label>
            <div class="layui-input-inline">
                <select name="type" id="type" lay-verify="required"  style="width:185px" >
                <option value="" >请选择文件类型</option>
                <option value="zip">zip</option>
                <option value="文档">文档</option>
                <option value="PDF">PDF</option>
                <option value="PPT">PPT</option>
            </select>
            </div>
        </div>
        
        <div class="layui-form-item">
            <label for="remark" class="layui-form-label" > <span
                    class="x-red">*</span>备注：
            </label>
            <div class="layui-input-inline">
                <input type="text" id="remark" name="remark" required=""
                       lay-verify="remark" autocomplete="off" class="layui-input">
            </div>
        </div>
        
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label" > </label>
            <input type="submit" class="layui-btn"  value="提交" >
        </div>
    </form>
</div>
</body>
<script src="/static/lib/layui/layui.js" charset="utf-8">
</script>
<script src="/static/js/x-layui.js" charset="utf-8">
</script>

<script>
		layui.use([ 'form', 'layer' ], function() {
			$ = layui.jquery;
			var form = layui.form(), layer = layui.layer;

			//自定义验证规则
			form.verify({
				nikename : function(value) {
					if (value.length < 5) {
						return '昵称至少得5个字符啊';
					}
				},
				pass : [ /(.+){6,12}$/, '密码必须6到12位' ],
				repass : function(value) {
					if ($('#L_pass').val() != $('#L_repass').val()) {
						return '两次输入的值不一致';
					}
				}
			});

			//监听提交
			form.on('submit(add)', function(data) {
				console.log(data);
				//发异步，把数据提交给php
				layer.alert("增加成功", {
					icon : 6
				}, function() {
					// 获得frame索引
					var index = parent.layer.getFrameIndex(window.name);
					//关闭当前frame
					parent.layer.close(index);
				});
				return false;
			});

		});
	</script>
	<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hm, s);
		})();
	</script>


</html>